<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 300px;
            height: 300px;
            background-color: #a7d790;
        }
        div::before{
            /* content不可或缺 */
            width: 100px;
            height: 100px;
            background-color: #2bdb13;
            content: "老鼠";  
            display: block;
        }
        div::after{
            content: "大米";
        }
    </style>
</head>
<body>
    <div class="box">郁郁而不得志</div>
</body>
</html>